


/*
'===============================================================================
'  HNG.Portal.BL.TblCustomerManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using System.Windows.Forms;
namespace HNG.Portal.BLL
{
	public class TblCustomerManagerBase
	{
	    
		#region ColumnNames
		
				public const String Field_Id="Id";
				
				public const String Field_LangId="LangId";
				
				public const String Field_GroupId="GroupId";
				
				public const String Field_UserName="UserName";
				
				public const String Field_Pass="Pass";
				
				public const String Field_FullName="FullName";
				
				public const String Field_Birthday="Birthday";
				
				public const String Field_Gender="Gender";
				
				public const String Field_Address="Address";
				
				public const String Field_Telephone="Telephone";
				
				public const String Field_Email="Email";
				
				public const String Field_LoGo="LoGo";
				
				public const String Field_Url="Url";
				
				public const String Field_Mota="Mota";
				
				public const String Field_Mobilephone="Mobilephone";
				
				public const String Field_CompanyName="CompanyName";
				
				public const String Field_CompanyAddress="CompanyAddress";
				
				public const String Field_CompanyPhone="CompanyPhone";
				
				public const String Field_Fax="Fax";
				
				public const String Field_Jobs="Jobs";
				
				public const String Field_Works="Works";
				
				public const String Field_Position="Position";
				
				public const String Field_ActivateCode="ActivateCode";
				
				public const String Field_Status="Status";
				
		#endregion	
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		public TblCustomerManagerBase()
		{
			// Nothing for now.
		}
		public DataTable Clone()
		{
			DataTable dt = new DataTable();
						
			
			dt.Columns.Add(Field_Id,typeof(int));
			
						
			
			dt.Columns.Add(Field_LangId,typeof(string));
			
						
			
			dt.Columns.Add(Field_GroupId,typeof(string));
			
						
			
			dt.Columns.Add(Field_UserName,typeof(string));
			
						
			
			dt.Columns.Add(Field_Pass,typeof(string));
			
						
			
			dt.Columns.Add(Field_FullName,typeof(string));
			
						
			
			dt.Columns.Add(Field_Birthday,typeof(DateTime));
			
						
			
			dt.Columns.Add(Field_Gender,typeof(string));
			
						
			
			dt.Columns.Add(Field_Address,typeof(string));
			
						
			
			dt.Columns.Add(Field_Telephone,typeof(string));
			
						
			
			dt.Columns.Add(Field_Email,typeof(string));
			
						
			
			dt.Columns.Add(Field_LoGo,typeof(string));
			
						
			
			dt.Columns.Add(Field_Url,typeof(string));
			
						
			
			dt.Columns.Add(Field_Mota,typeof(string));
			
						
			
			dt.Columns.Add(Field_Mobilephone,typeof(string));
			
						
			
			dt.Columns.Add(Field_CompanyName,typeof(string));
			
						
			
			dt.Columns.Add(Field_CompanyAddress,typeof(string));
			
						
			
			dt.Columns.Add(Field_CompanyPhone,typeof(string));
			
						
			
			dt.Columns.Add(Field_Fax,typeof(string));
			
						
			
			dt.Columns.Add(Field_Jobs,typeof(string));
			
						
			
			dt.Columns.Add(Field_Works,typeof(string));
			
						
			
			dt.Columns.Add(Field_Position,typeof(string));
			
						
			
			dt.Columns.Add(Field_ActivateCode,typeof(string));
			
						
			
			dt.Columns.Add(Field_Status,typeof(string));
			
			            
            return dt;			
		}
			
		public TblCustomerEntity Convert_Entity(TblCustomerEntity _TblCustomerEntity,TblCustomerEntity _TblCustomerEntity_XML)
		{	
			
				
			_TblCustomerEntity.Id= _TblCustomerEntity_XML.Id;
				
			_TblCustomerEntity.LangId= _TblCustomerEntity_XML.LangId;
				
			_TblCustomerEntity.GroupId= _TblCustomerEntity_XML.GroupId;
				
			_TblCustomerEntity.UserName= _TblCustomerEntity_XML.UserName;
				
			_TblCustomerEntity.Pass= _TblCustomerEntity_XML.Pass;
				
			_TblCustomerEntity.FullName= _TblCustomerEntity_XML.FullName;
				
			_TblCustomerEntity.Birthday= _TblCustomerEntity_XML.Birthday;
				
			_TblCustomerEntity.Gender= _TblCustomerEntity_XML.Gender;
				
			_TblCustomerEntity.Address= _TblCustomerEntity_XML.Address;
				
			_TblCustomerEntity.Telephone= _TblCustomerEntity_XML.Telephone;
				
			_TblCustomerEntity.Email= _TblCustomerEntity_XML.Email;
				
			_TblCustomerEntity.LoGo= _TblCustomerEntity_XML.LoGo;
				
			_TblCustomerEntity.Url= _TblCustomerEntity_XML.Url;
				
			_TblCustomerEntity.Mota= _TblCustomerEntity_XML.Mota;
				
			_TblCustomerEntity.Mobilephone= _TblCustomerEntity_XML.Mobilephone;
				
			_TblCustomerEntity.CompanyName= _TblCustomerEntity_XML.CompanyName;
				
			_TblCustomerEntity.CompanyAddress= _TblCustomerEntity_XML.CompanyAddress;
				
			_TblCustomerEntity.CompanyPhone= _TblCustomerEntity_XML.CompanyPhone;
				
			_TblCustomerEntity.Fax= _TblCustomerEntity_XML.Fax;
				
			_TblCustomerEntity.Jobs= _TblCustomerEntity_XML.Jobs;
				
			_TblCustomerEntity.Works= _TblCustomerEntity_XML.Works;
				
			_TblCustomerEntity.Position= _TblCustomerEntity_XML.Position;
				
			_TblCustomerEntity.ActivateCode= _TblCustomerEntity_XML.ActivateCode;
				
			_TblCustomerEntity.Status= _TblCustomerEntity_XML.Status;
				
			
			return _TblCustomerEntity;
		}	
		
			
		public void InsertCollection(EntityCollection _Collection)
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                adapter.SaveEntityCollection(_Collection);
            }
		}

		public TblCustomerEntity Insert(TblCustomerEntity TblCustomerEntity)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(TblCustomerEntity, true);
			}
			return TblCustomerEntity;
		}

		
		public TblCustomerEntity Insert(int Id, string LangId, string GroupId, string UserName, string Pass, string FullName, DateTime Birthday, string Gender, string Address, string Telephone, string Email, string LoGo, string Url, string Mota, string Mobilephone, string CompanyName, string CompanyAddress, string CompanyPhone, string Fax, string Jobs, string Works, string Position, string ActivateCode, string Status)
		{
			TblCustomerEntity _TblCustomerEntity = new TblCustomerEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_TblCustomerEntity.Id = Id;
				_TblCustomerEntity.LangId = LangId;
				_TblCustomerEntity.GroupId = GroupId;
				_TblCustomerEntity.UserName = UserName;
				_TblCustomerEntity.Pass = Pass;
				_TblCustomerEntity.FullName = FullName;
				_TblCustomerEntity.Birthday = Birthday;
				_TblCustomerEntity.Gender = Gender;
				_TblCustomerEntity.Address = Address;
				_TblCustomerEntity.Telephone = Telephone;
				_TblCustomerEntity.Email = Email;
				_TblCustomerEntity.LoGo = LoGo;
				_TblCustomerEntity.Url = Url;
				_TblCustomerEntity.Mota = Mota;
				_TblCustomerEntity.Mobilephone = Mobilephone;
				_TblCustomerEntity.CompanyName = CompanyName;
				_TblCustomerEntity.CompanyAddress = CompanyAddress;
				_TblCustomerEntity.CompanyPhone = CompanyPhone;
				_TblCustomerEntity.Fax = Fax;
				_TblCustomerEntity.Jobs = Jobs;
				_TblCustomerEntity.Works = Works;
				_TblCustomerEntity.Position = Position;
				_TblCustomerEntity.ActivateCode = ActivateCode;
				_TblCustomerEntity.Status = Status;
				adapter.SaveEntity(_TblCustomerEntity, true);
			}
			return _TblCustomerEntity;
		}

		public TblCustomerEntity Insert(string LangId, string GroupId, string UserName, string Pass, string FullName, DateTime Birthday, string Gender, string Address, string Telephone, string Email, string LoGo, string Url, string Mota, string Mobilephone, string CompanyName, string CompanyAddress, string CompanyPhone, string Fax, string Jobs, string Works, string Position, string ActivateCode, string Status)
		{
			TblCustomerEntity _TblCustomerEntity = new TblCustomerEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_TblCustomerEntity.LangId = LangId;
				_TblCustomerEntity.GroupId = GroupId;
				_TblCustomerEntity.UserName = UserName;
				_TblCustomerEntity.Pass = Pass;
				_TblCustomerEntity.FullName = FullName;
				_TblCustomerEntity.Birthday = Birthday;
				_TblCustomerEntity.Gender = Gender;
				_TblCustomerEntity.Address = Address;
				_TblCustomerEntity.Telephone = Telephone;
				_TblCustomerEntity.Email = Email;
				_TblCustomerEntity.LoGo = LoGo;
				_TblCustomerEntity.Url = Url;
				_TblCustomerEntity.Mota = Mota;
				_TblCustomerEntity.Mobilephone = Mobilephone;
				_TblCustomerEntity.CompanyName = CompanyName;
				_TblCustomerEntity.CompanyAddress = CompanyAddress;
				_TblCustomerEntity.CompanyPhone = CompanyPhone;
				_TblCustomerEntity.Fax = Fax;
				_TblCustomerEntity.Jobs = Jobs;
				_TblCustomerEntity.Works = Works;
				_TblCustomerEntity.Position = Position;
				_TblCustomerEntity.ActivateCode = ActivateCode;
				_TblCustomerEntity.Status = Status;
				adapter.SaveEntity(_TblCustomerEntity, true);
			}
			return _TblCustomerEntity;
		}

		public bool Update(TblCustomerEntity _TblCustomerEntity)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(TblCustomerFields.Id == _TblCustomerEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_TblCustomerEntity, filter);
				toReturn = true;
			}
			return toReturn;
		}
		
		public bool Update(TblCustomerEntity _TblCustomerEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_TblCustomerEntity, filter);
				toReturn = true;
			}
			return toReturn;
		}

		public bool Update(int Id, string LangId, string GroupId, string UserName, string Pass, string FullName, DateTime Birthday, string Gender, string Address, string Telephone, string Email, string LoGo, string Url, string Mota, string Mobilephone, string CompanyName, string CompanyAddress, string CompanyPhone, string Fax, string Jobs, string Works, string Position, string ActivateCode, string Status)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblCustomerEntity _TblCustomerEntity = new TblCustomerEntity(Id);
				if (adapter.FetchEntity(_TblCustomerEntity))
				{
				
					_TblCustomerEntity.LangId = LangId;
					_TblCustomerEntity.GroupId = GroupId;
					_TblCustomerEntity.UserName = UserName;
					_TblCustomerEntity.Pass = Pass;
					_TblCustomerEntity.FullName = FullName;
					_TblCustomerEntity.Birthday = Birthday;
					_TblCustomerEntity.Gender = Gender;
					_TblCustomerEntity.Address = Address;
					_TblCustomerEntity.Telephone = Telephone;
					_TblCustomerEntity.Email = Email;
					_TblCustomerEntity.LoGo = LoGo;
					_TblCustomerEntity.Url = Url;
					_TblCustomerEntity.Mota = Mota;
					_TblCustomerEntity.Mobilephone = Mobilephone;
					_TblCustomerEntity.CompanyName = CompanyName;
					_TblCustomerEntity.CompanyAddress = CompanyAddress;
					_TblCustomerEntity.CompanyPhone = CompanyPhone;
					_TblCustomerEntity.Fax = Fax;
					_TblCustomerEntity.Jobs = Jobs;
					_TblCustomerEntity.Works = Works;
					_TblCustomerEntity.Position = Position;
					_TblCustomerEntity.ActivateCode = ActivateCode;
					_TblCustomerEntity.Status = Status;
					adapter.SaveEntity(_TblCustomerEntity, true);
					toReturn = true;
				}
			}
			return toReturn;
		}

		public bool Delete(int Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblCustomerEntity _TblCustomerEntity = new TblCustomerEntity(Id);
				if (adapter.FetchEntity(_TblCustomerEntity))
				{
					adapter.DeleteEntity(_TblCustomerEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("TblCustomerEntity", null);
			}
		}
		
		
		public int DeleteById(int Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLangId(string LangId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByGroupId(string GroupId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.GroupId == GroupId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUserName(string UserName)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByPass(string Pass)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Pass == Pass);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByFullName(string FullName)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.FullName == FullName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByBirthday(DateTime Birthday)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Birthday == Birthday);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByGender(string Gender)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Gender == Gender);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByAddress(string Address)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Address == Address);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByTelephone(string Telephone)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Telephone == Telephone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByEmail(string Email)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLoGo(string LoGo)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LoGo == LoGo);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUrl(string Url)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Url == Url);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByMota(string Mota)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mota == Mota);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByMobilephone(string Mobilephone)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mobilephone == Mobilephone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCompanyName(string CompanyName)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyName == CompanyName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCompanyAddress(string CompanyAddress)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyAddress == CompanyAddress);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCompanyPhone(string CompanyPhone)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyPhone == CompanyPhone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByFax(string Fax)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Fax == Fax);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByJobs(string Jobs)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Jobs == Jobs);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByWorks(string Works)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Works == Works);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByPosition(string Position)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Position == Position);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByActivateCode(string ActivateCode)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.ActivateCode == ActivateCode);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByStatus(string Status)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Status == Status);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("TblCustomerEntity", filter);
			}
			return toReturn;
		}
		

		
		public TblCustomerEntity SelectOne(int Id)
		{
			TblCustomerEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				TblCustomerEntity _TblCustomerEntity = new TblCustomerEntity(Id);
				if (adapter.FetchEntity(_TblCustomerEntity))
				{
					toReturn = _TblCustomerEntity;
				}
			}
			return toReturn;
		}

		// Return EntityCollection
		public EntityCollection SelectAll()
		{
			EntityCollection _TblCustomerCollection = new EntityCollection( new TblCustomerEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, null, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}

		
		// Return EntityCollection
		public EntityCollection SelectById(int Id)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(int Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByLangId(string LangId)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLangIdRDT(string LangId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LangId == LangId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByGroupId(string GroupId)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.GroupId == GroupId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByGroupIdRDT(string GroupId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.GroupId == GroupId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByUserName(string UserName)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUserNameRDT(string UserName)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.UserName == UserName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByPass(string Pass)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Pass == Pass);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByPassRDT(string Pass)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Pass == Pass);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByFullName(string FullName)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.FullName == FullName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByFullNameRDT(string FullName)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.FullName == FullName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByBirthday(DateTime Birthday)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Birthday == Birthday);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByBirthdayRDT(DateTime Birthday)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Birthday == Birthday);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByGender(string Gender)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Gender == Gender);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByGenderRDT(string Gender)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Gender == Gender);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByAddress(string Address)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Address == Address);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByAddressRDT(string Address)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Address == Address);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByTelephone(string Telephone)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Telephone == Telephone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByTelephoneRDT(string Telephone)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Telephone == Telephone);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByEmail(string Email)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByEmailRDT(string Email)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Email == Email);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByLoGo(string LoGo)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LoGo == LoGo);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLoGoRDT(string LoGo)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.LoGo == LoGo);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByUrl(string Url)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Url == Url);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUrlRDT(string Url)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Url == Url);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByMota(string Mota)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mota == Mota);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByMotaRDT(string Mota)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mota == Mota);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByMobilephone(string Mobilephone)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mobilephone == Mobilephone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByMobilephoneRDT(string Mobilephone)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Mobilephone == Mobilephone);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByCompanyName(string CompanyName)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyName == CompanyName);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCompanyNameRDT(string CompanyName)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyName == CompanyName);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByCompanyAddress(string CompanyAddress)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyAddress == CompanyAddress);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCompanyAddressRDT(string CompanyAddress)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyAddress == CompanyAddress);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByCompanyPhone(string CompanyPhone)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyPhone == CompanyPhone);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCompanyPhoneRDT(string CompanyPhone)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.CompanyPhone == CompanyPhone);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByFax(string Fax)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Fax == Fax);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByFaxRDT(string Fax)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Fax == Fax);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByJobs(string Jobs)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Jobs == Jobs);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByJobsRDT(string Jobs)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Jobs == Jobs);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByWorks(string Works)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Works == Works);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByWorksRDT(string Works)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Works == Works);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByPosition(string Position)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Position == Position);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByPositionRDT(string Position)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Position == Position);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByActivateCode(string ActivateCode)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.ActivateCode == ActivateCode);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByActivateCodeRDT(string ActivateCode)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.ActivateCode == ActivateCode);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection
		public EntityCollection SelectByStatus(string Status)
		{
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Status == Status);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_TblCustomerCollection, filter, 0, null);
			}
			return _TblCustomerCollection;
		}
		
		// Return DataTable
		public DataTable SelectByStatusRDT(string Status)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _TblCustomerCollection = new EntityCollection(new TblCustomerEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(TblCustomerFields.Status == Status);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_TblCustomerCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		

	}
}
